<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ～ ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------

// you should use `$router`
use catchAdmin\project\controller\Project;

/* @var think\Route $router */

$router->group(function () use ($router) {
    //问卷管理
    $router->resource('project', Project::class);
    $router->post('GetSatisfactionNodeByPoint', '\catchAdmin\project\controller\Project@getSatisfactionNodeByPoint');
    $router->get('getProjectTree', '\catchAdmin\project\controller\Project@getTreeProjectList');
    $router->any('getProjectByDept', '\catchAdmin\project\controller\Project@getProjectByDept');
    $router->resource("answer", \catchAdmin\project\controller\Answer::class);
    $router->get("getAnswerDetail/<id>", '\catchAdmin\project\controller\Answer@getAnswerDetailByFollowId');
    $router->get("queSummary", '\catchAdmin\project\controller\Answer@getQuestionnaireSummary');
    $router->resource("questions", \catchAdmin\project\controller\Questions::class);
    $router->any("NodeSatisfactionReport", "\catchAdmin\project\controller\Questions@nodeSatisfactionReport");
    $router->any("HospitalizationSatisfactionReport", "\catchAdmin\project\controller\Questions@hospitalizationSatisfactionReport");
    $router->any("SatisfactionFormReport", "\catchAdmin\project\controller\Questions@satisfactionFormReport");
    $router->any("getAnswerStatistics", '\catchAdmin\project\controller\Answer@getAnswerStatistics');
    $router->any("getChronicDiseaseEvaluationList", '\catchAdmin\project\controller\Project@getChronicDiseaseEvaluationList');
    $router->any("satisfactionProjectReport", '\catchAdmin\project\controller\Project@satisfactionProjectReport');
    $router->post("modChartType", '\catchAdmin\project\controller\Answer@modChartType');
    $router->resource("chronicDiseases", \catchAdmin\project\controller\ChronicDisease::class);

    //满意度节点
    $router->resource('satisfaction', \catchAdmin\project\controller\Satisfaction::class);
    //获取全部满意度节点
    $router->get('get_satisfaction', '\catchAdmin\project\controller\Satisfaction@get_satisfaction');
    //满意度答案
    $router->resource('satisfactionAnswer', \catchAdmin\project\controller\SatisfactionAnswer::class);
    //获取全部满意度答案
    $router->get('get_satisfaction_answer', '\catchAdmin\project\controller\SatisfactionAnswer@get_satisfaction_answer');
    $router->resource('Nodes', \catchAdmin\project\controller\Node::class);
    $router->any('getProjectListByDeptId', '\catchAdmin\project\controller\Project@getProjectListByDeptId');

    //模板主题
    $router->resource('projectTheme', \catchAdmin\project\controller\ProjectTheme::class);
})->middleware('auth');

$router->group("api", function () use ($router) {
    $router->get("getProjectInfo/:id", "\catchAdmin\project\controller\Project@getProjectInfo");
    $router->post('createAnswer', "\catchAdmin\project\controller\Answer@save");
    $router->any('startAnswer', "\catchAdmin\project\controller\Answer@startAnswer");
});

